<template>
  <div class="home">
    <home_title></home_title>
    <van-swipe :autoplay="3000">
      <van-swipe-item style="width:420px;height:272px" v-for="(image, index) in imgs" :key="index"
        ><img style="width:420px;height:272px" v-lazy="image"
      /></van-swipe-item>
    </van-swipe>
    <div class="line"></div>
    <van-tabs v-model="active">
      <van-tab title="考试活动">
        <van-row
          v-for="value in 5"
          :key="value"
          type="flex"
          justify="center"
          class="test_content"
        >
          <van-col span="12">
            <p>生物考试</p>
            <p>类型：学习</p>
          </van-col>
          <van-col span="6" offset="6">
            <button @click="but">
              开始
            </button>
          </van-col>
        </van-row>
      </van-tab>
    </van-tabs>
    <tabbar></tabbar>
  </div>
</template>

<script>
import Home_title from "@/components/Home_titleView.vue";
import Tabbar from "@/components/TabbarView.vue";
import axios from "axios";


export default {
  components: {
    Home_title,
    Tabbar,
  },
  data() { 
    return {
      active: "home",
      imgs: [
        "https://www.hualigs.cn/image/6278b1ddada05.jpg",
        "https://www.hualigs.cn/image/6278b1de29b43.jpg",
        "https://www.hualigs.cn/image/6278b1de39ac6.jpg",
      ],
    };
  },
  created() {
    // let _that = this;
    axios
      .get("/api/vue_admin")
      .then((response) => {
        // handle success
        // console.log(this);
        this.news = response.data.data;
      })
      .catch(function (error) {
        // handle error
        console.log(error);
      });
  },

  methods: {

    but(){
      this.$router.push('/timu')
    }
  },
};
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 250px;
  text-align: center;
  background-color: #39a9ed;
}
.test_content {
  border: lightgray solid 1px;
  border-radius: 15px;
  margin: 10px 20px;
  padding: 0px 15px;
}
.test_button {
  margin-top: 25px;
}
.line {
  background-color: lightgray;
  height: 10px;
  padding: 0;
}
.home {
  background: url("../../public/img/home.jpg");
}
p {
  color: white;
}
</style>
